package tw.edu.tku.im.maze;
import org.json.JSONException;
import org.json.JSONObject;


public class LeaveRoomRepParser extends PacketParser {
   public static LeaveRoomRepParser INSTANCE = new LeaveRoomRepParser();
   
   private LeaveRoomRepParser() { }
   
   @Override
   public LeaveRoomRep parse(JSONObject jsonObj) throws JSONException {
      JSONObject result = jsonObj.getJSONObject("result");
      int state = result.getInt("state");
      return new LeaveRoomRep(state);
   }

   @Override
   public String acceptName() {
      return "leaveRoomResponse";
   }
   
}
